package com.hr.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * @author DSL
 * @create 2024-10-28 15:50
 */
@Configuration// 配置类
@ComponentScan( "com.hr")// 扫描包
@EnableWebMvc// 开启MVC模式作用：1.扫描@Controller 2.视图解析器 3.欢迎页 4.静态资源
public class WebMvcJavaConfig implements WebMvcConfigurer {
//    开启视图解析处理
    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
       configurer.enable();
    }
    // 静态资源解析器
    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        WebMvcConfigurer.super.configureViewResolvers(registry);
    }
//    开启拦截器

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    }

}
